<template>
  <div class="app">
    <van-search v-model="value" clearable placeholder="请输入搜索关键词" @search="handleSearch" />
    <div class="type_tabs">
      <div class="type_tab">
        <span>品种</span>
      </div>
      <div class="type_tab">
        <span>最新均价</span>
      </div>
      <div class="type_tab pri">
        <span>涨跌（比昨日）</span>
      </div>
    </div>
    <template v-if="list.length > 0">
      <div class="items">
        <div class="item">
          <div class="i1">蜜桃雪山（香槟...</div>
          <div class="i2">
            23.34 <span>+23.32 <img src="@/assets/img/s.png" alt="" /></span>
          </div>
          <div class="i3">
            <div class="zf">+1.23%</div>
          </div>
        </div>
        <div class="item">
          <div class="i1">蜜桃雪山（香槟...</div>
          <div class="i2">
            23.34 <span class="active">+23.32 <img src="@/assets/img/x.png" alt="" /></span>
          </div>
          <div class="i3">
            <div class="zf active">+1.23%</div>
          </div>
        </div>
      </div>
    </template>
    <div v-else align="center">
      <img src="@/assets/img/zanwu.png" style="width: 200px; margin-top: 136px" alt="" />
    </div>
  </div>
</template>

<script>
import { Search, Toast } from 'vant'

export default {
  components: {
    [Search.name]: Search,
    [Toast.name]: Toast
  },
  name: 'App',
  data() {
    return {
      value: '', // 搜索框的值
      list: ['wd'] // 列表
    }
  },
  created() {},
  methods: {
    // 搜索
    handleSearch() {}
  }
}
</script>
<style lang='scss' scoped>
.van-search{
  background-color:#F7F7F7 ;
}
.van-search__content{
  background-color: #ffffff;
  border-radius: 15px;
}
.type_tabs {
  display: flex;
  align-items: center;
  background-color: #fff;
  height: 50px;
  border-bottom: 1px solid #eeeeee;
  .type_tab {
    width: 33.333333%;
    display: flex;
    align-items: center;
    justify-content: center;
    span {
      font-size: 14px;
      color: #666666;
    }
    span.on {
      color: #333333;
    }
    img {
      width: 8px;
      height: 8px;
      margin-left: 6px;
    }
  }
}
.items{
  padding:20px 15px;
  background-color: #ffffff;
  padding-bottom: 5px;
  .item{
    display: flex;
    margin-bottom: 16px;
    div{
      width:33.333333%;
    }
    .i1{
      font-size: 13px;
      color: #333333;
      line-height: 30px;
      padding-right: 10px;
      box-sizing: border-box;
      overflow: hidden;white-space: nowrap;text-overflow: ellipsis;
    }
    .i2{
       font-size: 14px;
      color: #333333;
      display: flex;
      align-items: center;
      justify-content: center;
      span{
        color: #FF4141;
        margin-left: 6px;
        display: flex;
        align-items: center;
        font-size: 12px;
        img{
          width: 14px;
          height: 14px;
        }
      }
      span.active{
        color:#46BB56
      }
    }
    .i3{
      padding-left: 10px;
      box-sizing: border-box;
      .zf{
        width: 70px;
        height: 30px;
        background-color:rgba(255, 97, 97, 0.15) ;
        color: #FF4141;
        font-size: 14px;
        text-align: center;
        line-height: 30px;
        margin:0 auto;
border-radius: 4px;
      }
      .zf.active{
        background-color: rgba(70, 187, 86, 0.15);
        color: #46BB56;
      }
    }
  }
}
</style>
